![]() Method for maintaining blockchain parallel chain and blockchain parallel chain
专利摘要:
The present application provides a method for maintaining a blockchain parallel chain and a blockchain parallel chain. The method includes: determining a to-be-synchronized block in an access-chain blockchain; generating a parallel-chain block conforming to a specification form of a public chain, where the parallel-chain block includes block data in the to-be-synchronized block; and adding the parallel-chain block to a parallel-chain blockchain, so that the public chain can reads the block data in the to-be-synchronized block. In the present application, the parallel chain generates the parallel-chain block conforming to the specification form of the public chain, and enables the block data in the to-be-synchronized block in the access-chain blockchain to be included in the parallel-chain block. Because a parallel-chain node per se is a public-chain node, the parallel chain is a subchain of the public chain. As a part of the public chain, the subchain is consistent with the public chain in terms of nodes and a network system. Therefore, a blockchain of the subchain may be directly accessed by the public chain. Therefore, when performing a cross-chain transaction, the public chain may read block data of the access chain from the parallel chain in a manner of reading block data of the subchain, to implement the cross-chain transaction. 公开号:FI20206356A1 申请号:FI20206356 申请日:2019-08-16 公开日:2020-12-22 发明作者:Jie Bai;Xianfeng Wu;Dongyun Li 申请人:Jiangsu Aowei Holdings Co Ltd; IPC主号:
专利说明:
[0001] [0001] The present application claims a priority to the Chinese Application No. [0002] [0002] The present application relates to a technical field of blockchains, and in particular, to a method for maintaining a blockchain parallel chain and a blockchain parallel chain.BACKGROUND OF THE INVENTION [0003] [0003] The blockchain provides decentralized system thinking whose most basic principle is — creating a relatively objective non-repudiation digital environment in a well-known manner of consensus. A blockchain technology may enable that network information cannot be modified once being published. For example, if a transaction occurs in a blockchain network, a node in S the blockchain network may record the transaction in a generated block, and then adds the block N to a blockchain, and broadcasts the block over the whole network, to form a blockchain that = 20 — cannot be modified. Therefore, the blockchain essentially is a distributed public ledger, N comprises a plurality of data blocks, and is maintained by various nodes together. Nodes that a maintain a same blockchain form a physical chain, such as a public chain, a private chain, or a E federated chain, and these nodes together form a peer-to-peer network that bears the ä blockchain. [0004] [0004] Ablockchain transaction generally occurs between two nodes within a range of a same blockchain network. However, with applications of the blockchain technology, the transaction 1 sometimes needs to cross two or more blockchain networks, thus forming a cross-chain transaction. To implement cross-chain transactions, different blockchain networks may implement cross-chain transactions between each other by accessing a same public chain. For example, a blockchain network N1 and a blockchain network N2 both access a public chain N3. When a node A in the blockchain network NI initiates a transaction to a node B in the blockchain network N2, the public chain N3 regulates and controls in the middle, and is responsible for transmitting information between the two blockchain networks, to complete the cross-chain transaction. However, no matter for a cross-chain transaction between different access chains or a cross-chain transaction between the public chain and the access chain, the — public chain needs to obtain block data, in a access-chain blockchain, that records a specific transaction, to implement the cross-chain transaction. [0005] [0005] In an accessing manner of accessing the public chain through a parallel chain, the parallel chain, serving as a blockchain network that comprises common nodes of the access chain and the public chain, stores both an access-chain blockchain and a public-chain — blockchain. However, due to differences between different blockchain networks, for example, a difference between consensus mechanisms or a difference between communication mechanisms, the public chain cannot obtain block data from the access-chain blockchain. Therefore, the cross-chain transaction between different blockchain networks cannot be implemented.SUMMARY OF THE INVENTION [0006] [0006] The present application provides a method for maintaining a blockchain parallel chain S and a blockchain parallel chain, may be used to resolve a problem in the prior art that a N cross-chain transaction between different blockchain networks cannot be implemented because iq a public chain cannot obtain block data from an access-chain blockchain. - [0007] According to a first aspect, the present application provides a method for maintaining , 25 —ablockchain parallel chain, where the method includes: E [0008] determining a to-be-synchronized block in an access-chain blockchain; ä [0009] generating a parallel-chain block conforming to a specification form of a public chain, where the parallel-chain block includes block data in the to-be-synchronized block; and [0010] [0010] adding the parallel-chain block to a parallel-chain blockchain, so as to read the block 2 data in the to-be-synchronized block from the parallel-chain blockchain by the public chain. [0011] [0011] Optionally, the generating a parallel-chain block conforming to a specification form of a public chain includes: [0012] [0012] generating an index identifier for indicating the block data in the to-be-synchronized — block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; [0013] [0013] generating a block header conforming to the specification form of the public chain, where the block header includes the index identifier, the access-chain block identifier, and a parallel-chain block identifier for indicating the parallel-chain block in the parallel-chain blockchain; and [0014] [0014] copying the block data in the to-be-synchronized block to a position after the block header, to generate the parallel-chain block. [0015] [0015] Optionally, the generating a parallel-chain block conforming to a specification form of a public chain includes: [0016] [0016] generating an index identifier for indicating the block data in the to-be-synchronized block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; [0017] [0017] generating a block header conforming to the specification form of the public chain, where the block header includes a parallel-chain block identifier for indicating the parallel-chain — block in the parallel-chain blockchain; [0018] [0018] adding the access-chain block identifier to a position after the block header; S [0019] adding the index identifier to a position after the access-chain block identifier N according to a type of the block data, where the type of the block data includes transaction iq information, state information, receipt information, and data information; and - 25 [0020] converting the block data into data conforming to the specification form of the public , chain, and adding the data to a position after the index identifier, to generate the parallel-chain : block. O [0021] Optionally, after the generating a parallel-chain block conforming to a specification form of a public chain, the method further includes: [0022] [0022] sending digest information corresponding to the block data to the public chain, so as to 3 read the block data in the to-be-synchronized block from the parallel-chain blockchain by the public chain based on the digest information, where the digest information includes the access-chain block identifier, the parallel-chain block identifier, and the index identifier, which correspond to the block data. [0023] [0023] Optionally, the determining to-be-synchronized blocks in an access-chain blockchain includes: [0024] [0024] determining a number of current blocks in the access-chain blockchain as m; [0025] [0025] determining first (m-n) blocks in the access-chain blockchain as consensus blocks, where n is a preset value, the consensus blocks are blocks in the access-chain blockchain on — which access-chain nodes have reached a consensus, and n is a positive integer greater than O; and [0026] [0026] determining, based on the access-chain block identifier in the parallel-chain blockchain, a block in the consensus blocks whose block data is not synchronized is as the to-be-synchronized block. [0027] [0027] Optionally, a number of the to-be-synchronized blocks is k, and k is a positive integer greater than or equal to 2; and [0028] [0028] the generating a parallel-chain block conforming to a specification form of a public chain includes: [0029] [0029] generating a parallel-chain block conforming to the specification form of the public — chain whenever a preset duration passes, where the preset duration is k times greater than a duration required by the access chain to generate a block. 9 [0030] Optionally, the method further includes: N [0031] periodically selecting a maintainer node of the parallel chain from nodes in the parallel - chain, where the parallel-chain block is generated by the maintainer node of the parallel chain. N 25 [0032] According to a second aspect, the present application provides a blockchain parallel a chain, where the parallel chain consists of nodes common to a public chain and an access chain, E and includes a maintainer node of the parallel chain, as which a node is periodically selected N from the nodes in the parallel chain; and - [0033] the maintainer node of the parallel chain is configured to: determine a — to-be-synchronized block in an access-chain blockchain; generate a parallel-chain block 4 conforming to a specification form of the public chain, where the parallel-chain block includes block data in the to-be-synchronized block; and add the parallel-chain block to a parallel-chain blockchain, so as to read the block data in the to-be-synchronized block from the parallel-chain blockchain by the public chain. [0034] [0034] In the present application, the maintainer node of the parallel chain generates the parallel-chain block conforming to the specification form of the public chain, and enables the block data in the to-be-synchronized block in the access-chain blockchain to be included in the parallel-chain block. Because a parallel-chain node per se is a public-chain node, the parallel chain is a subchain of the public chain. As a part of the public chain, the subchain is consistent with the public chain in terms of nodes and a network system. Therefore, a blockchain of the subchain may be directly accessed by the public chain. Therefore, when performing a cross-chain transaction relevant to the access chain, the public chain may read block data of the access chain from the parallel-chain block in manner of reading block data of the subchain, to implement the cross-chain transaction.BRIEF DESCRIPTION OF THE DRAWINGS [0035] [0035] To more clearly describe the technical solutions of the embodiments of the present application, the accompanying drawings required in the description of the embodiments are briefly illustrated below. Apparently, the accompanying drawings in the description below are merely some embodiments of the present application, and other accompanying drawings may also be obtained by one of ordinary skills in the art according to these accompanying drawings S without an effective effort. N [0036] FIG 1 is a schematic diagram illustrating network architectures between a public = chain, a parallel chain, and an access chain according to an exemplary embodiment; N [0037] FIG. 2 is a schematic flowchart illustrating a method for maintaining a blockchain a 25 — parallel chain according to an exemplary embodiment; E [0038] FIG. 3 is a schematic diagram illustrating generating a parallel-chain block according ä to an exemplary embodiment; [0039] [0039] FIG 4 is a schematic diagram illustrating generating a parallel-chain block according to another exemplary embodiment; and 5 [0040] [0040] FIG. 5 is a flowchart illustrating a method of obtaining a to-be-synchronized block in an access-chain blockchain according to an exemplary embodiment.DETAILED DESCRIPTION OF THE EMBODIMENTS [0041] [0041] Embodiments are described below in detail, and examples thereof are shown in the accompanying drawings. When the descriptions below relate to the accompanying drawings, unless otherwise stated, same numbers in different accompanying drawings indicate same or similar elements. Implementations described in the following exemplary embodiments do not represent all implementations in accordance with the present application, merely examples of a method in accordance with some aspects of the present application as described in detail in the — claims. [0042] [0042] In technical solutions provided in the present application, a blockchain network refers to a peer-to-peer network composed of nodes that maintain a blockchain. The blockchain network may perform operations on the maintained blockchain, such as, distributed storage, public consensus, digital encryption, transaction accounting, verifications, and the like. A block — includes a plurality of block data, and a plurality of blocks form a blockchain. Block data in the blockchain or in a blockchain block are data which are recorded by the node maintaining the blockchain according to the transaction and a generated result when a transaction occurs in the blockchain network. The block is also referred to as a data block, such as a data block of a parallel chain, a data block of a public chain, or the like. There are a plurality of types of block — data, which are used to indicate specific content, results, and states of the transaction, such as S transaction information, state information, receipt information, and data information. The N transaction information is used to indicate specific content of the transaction. For example, if a iq user A transfers RMB 300 to a user B, the node in the blockchain generates a piece of - transaction information, which records the transaction content that the user A transfers RMB a 25 300 to the user B. The state information is used to indicate a state of the transaction. For E example, the user A transfers RMB 300 to the user B. During a process in which user A transfers N RMB 300 to user B, in order to represent that transferring is in progress, the node in the - blockchain generates a piece of state information, to record that the transferring transaction is in progress. The receipt information is used to indicate a result of the transaction. For example, if 6 the user A transfers RMB 300 to the user B, RMB 300 is reduced from an account of the user A. Correspondingly, the node in the blockchain generates a piece of receipt information, to record an account balance of the account of the user A after RMB 300 is transferred out. The data information is used to indicate data stored in the blockchain network. The blockchain network — hasa function of storing in a distributed manner. The nodes that maintain the blockchain may store data to be stored by the user in a distributed manner. When storing the data, the node in the blockchain may generate data information, to record the stored data. It should be noted that the foregoing explanations to the transaction information, the state information, the receipt information, and the data information are only exemplary and explanatory descriptions to the — types of the block data, and are not used to limit the present application. In addition to the foregoing four types, the block data further includes other types of information. This is not enumerated in the present application. [0043] [0043] A node in the blockchain network may be a physical node, such as a terminal or a server, or may be a virtual node. On the basis of a same consensus mechanism, nodes in the IS — same blockchain network communicate with each other and maintain running of the blockchain network. [0044] [0044] In the present application, the referred public chain, access chain, and parallel chain all refer to different blockchain networks that conform to a blockchain technology. In a technical solution provided in the present application, the public chain, as a basic network platform, — comprises a plurality of public-chain nodes, and may be accessed by a plurality of blockchain networks. The blockchain network accessing the public chain is referred to as an access chain, S such as bitcoins or Ethereum in the existing blockchain network, or an industry chain and a N federated chain developed in some industries, or even a private chain established for satisfying iq certain service requirement. These existing blockchain, industry chain, federated chain, and - 25 — private chain generally cannot be directly connected to the public chain. Therefore, in the a present application, the public chain and the access chain may be connected through the parallel io chain. [0046] [0046] In the present application, cross-chain transactions in which the public chain participates may include: a transaction occurring between the access chain and the public chain, such as a query transaction, an accessing transaction, or a synchronization transaction. For such — a cross-chain transaction, because the public chain directly transacts with the access chain, the public chain needs to obtain block data in a access-chain blockchain. The cross-chain transactions in which the public chain participates may further include a transaction relayed or transferred by the public chain. In such a cross-chain transaction, one access chain serves as a transaction initiator party, and another access chain serves as a transaction target party. For IS — example, an access chain A needs to pay tokens a thereof to exchange for tokens b of the other access chain B. For such a cross-chain transaction, the access chain A cannot directly transact with the access chain B, and a public chain C is required to transfer information and data relevant to the transaction. To make sure that the cross-chain transaction can be successfully completed, the public chain C needs to determine whether the access chain A and the access chain B may complete respective transaction content that needs to be completed during the cross-chain transaction, for example, whether the access chain A may pay tokens a required for S the transaction. Therefore, the public chain needs to obtain block data in blockchains of both N parties of the transaction. In view of the above, no matter for a cross-chain transaction between iq different access chains or a cross-chain transaction between the public chain and the access - 25 — chain, the public chain needs to obtain block data recorded in the access-chain blockchain, to , implement the cross-chain transaction. E [0047] It may be learned from the foregoing content that the public chain needs to obtain the N block data recorded in the access-chain blockchain during the cross-chain transaction so as to - complete the cross-chain transaction. However, the public chain and the access chain are two different blockchain networks. Because the public chain and the access chain have different 8 consensus mechanisms, different communication mechanisms, and the like, although the parallel chain stores the blockchains of the two, the public chain also cannot directly obtain the block data in the access-chain blockchain from the parallel chain. Therefore, the present application provides a method for maintaining a blockchain parallel chain. Through maintaining — the parallel chain, the public chain is enabled to obtain the block data in the access-chain blockchain from the parallel chain. [0048] [0048] Refer to FIG. 2, and FIG. 2 exemplarily shows a schematic flowchart illustrating a method for maintaining a blockchain parallel chain according to the present application. The method includes the following steps. [0049] [0049] Step S20: Determine to-be-synchronized blocks in an access-chain blockchain. [0050] [0050] In the present application, through maintaining a parallel chain, that is, maintaining a parallel-chain blockchain, a public chain is enabled to obtain block data in the access-chain blockchain from the parallel-chain blockchain. Therefore, the parallel chain first needs to determine a maintainer node of the parallel chain that is responsible for maintaining the parallel IS — chain. The maintainer node of the parallel chain is configured to maintain affairs relevant to the parallel chain, such as generating a block and recording a cross-chain transaction. In an embodiment of the present application, there are two manners to determine the maintainer node of the parallel chain from nodes in the parallel chain. [0051] [0051] In a possible implementation, all nodes in the parallel chain are maintainer nodes of — the parallel chain. The parallel chain sets all nodes as the maintainer nodes of the parallel chain, so as to make sure that all nodes in the parallel chain may maintain the parallel chain. In this S way, each node in the parallel chain has a right of obtaining benefits. N [0052] In another possible implementation, the maintainer nodes of the parallel chain are = periodically selected from the nodes in the parallel chain. The selected maintainer node of the N 25 — parallel chain maintains the parallel chain in a next period. A maintainer node of the parallel a chain in a current period selects a maintainer node of the parallel chain for a next period, and the E maintainer node of the parallel chain for the current period does not serve as the maintainer N node of the parallel chain in the next period. Therefore, nodes that serve as maintainers - dynamically change, and the maintainer nodes of the parallel chain are not served by particular nodes any more. In this way, a possibility of cracking the parallel chain is reduced, and safety of 9 the parallel chain may be improved. In addition, some nodes in the parallel chain are selected as the maintainer nodes of the parallel chain, thus avoiding a whole-network operation of maintaining the parallel chain. Therefore, operation efficiency of the parallel chain may be improved. Duration of the foregoing period is greater than duration for selecting the maintainer node of the parallel chain, and is smaller than duration for cracking the maintainer node of the parallel chain. By limiting the duration of the period, not only it may be ensured that the selection is completed within the period, but also a possibility of cracking the maintainer node of the parallel chain is reduced. For a selection manner, the maintainer node of the parallel chain for the current period may be randomly selected, may be selected according to operation efficiency of each parallel-chain node, or may be selected according to safety performance of each parallel-chain node. The selection manner is not specifically limited in this embodiment of the present application. [0053] [0053] After the maintainer node of the parallel chain is selected, the maintainer node of the parallel chain in the current period determines the to-be-synchronized block in the access-chain IS — blockchain. To enable the public chain to obtain the block data in the access-chain blockchain from the parallel-chain blockchain, the parallel chain needs to synchronize the block data in the access-chain blockchain into a parallel-chain block thereof, that is, add the block data of the access chain to a parallel-chain block generated by the maintainer node of the parallel chain. The to-be-synchronized block is an access-chain block whose block data has not been synchronized to the parallel-chain block. [0054] [0054] Since there is the access-chain blockchain stored in the parallel chain, and the S parallel-chain node itself is also an access-chain node., the maintainer node of the parallel N chain may directly obtain a block and the block data in the access-chain blockchain. When - determining the to-be-synchronized block, the maintainer node of the parallel chain determines, N 25 — from the block data in the access-chain blockchain, block data that has not been synchronized to , the parallel-chain blockchain, so as to take access-chain blocks to which the block data belongs E as the to-be-synchronized blocks. N [0055] Step S21: Generate a parallel-chain block conforming to a specification form of a - public chain. [0056] [0056] The maintainer node of the parallel chain generates the parallel-chain block 10 conforming to the specification form of the public chain. When generating the parallel-chain block, the maintainer node of the parallel chain adds block data in the to-be-synchronized block to the generated parallel-chain block. This embodiment of the present application provides two manners for generating the parallel-chain block. [0057] [0057] For the first manner, the block data in the to-be-synchronized block is directly taken as a part of content in the parallel-chain block. Specifically, the maintainer node of the parallel chain first generates an index identifier and an access-chain block identifier. The index identifier is used for indicating the block data in the to-be-synchronized block. The to-be-synchronized block may include a plurality of block data. The maintainer node of the parallel chain generates an index identifier for each block data in the to-be-synchronized block. The index identifier of a piece of block data indicates this block data. The public chain or the parallel chain may determine the corresponding block data based on the index identifier. For example, a piece of block data is transaction information of a transaction. The maintainer node of the parallel chain performs a hash operation on the transaction information, to obtain a hash value corresponding IS — to the transaction information. The hash value is an index identifier. The access-chain block identifier is configured to indicate the to-be-synchronized block in the access-chain blockchain. Whenever generating the parallel-chain block, the maintainer node of the parallel chain may synchronize a plurality of to-be-synchronized blocks. The maintainer node of the parallel chain generates a corresponding access-chain block identifier for each to-be-synchronized block. For example, the access-chain block identifier may be a block sequence number of the to-be-synchronized block in the access-chain blockchain, or may be a combination of a block o seguence number and a block hash value. N [0058] Subseguently, the maintainer node of the parallel chain generates a block header iq conforming to the specification form of the public chain. The block header is a block header that - 25 is of the parallel-chain block and needs to be generated by the maintainer node of the parallel , chain. The block header includes the index identifier of each block data in the E to-be-synchronized block, and the access-chain block identifier corresponding to each N to-be-synchronized block and a parallel-chain block identifier. Similar to the access-chain block - identifier, the parallel-chain block identifier may be a block seguence number of the — parallel-chain block, or may be a combination of a block sequence number and a block hash 11 value. After the block header is generated, the maintainer node of the parallel chain directly copies the block data in the to-be-synchronized block to a position following the block header, to generate the parallel-chain block. [0059] [0059] For example, as shown in FIG. 3, the to-be-synchronized blocks are a 500 block 30 and a 501" block 31 in a blockchain A of the access chain. The two to-be-synchronized blocks respectively include two pieces of block data: T1 and T2, and T3 and T4. A 250% block 32 in a blockchain B of the parallel chain is generated by the maintainer node of the parallel chain. [0060] [0060] For the second manner, the maintainer node of the parallel chain deconstructs and restructures the to-be-synchronized block, to generate a block whose data may be directly read S by the public chain. Specifically, the maintainer node of the parallel chain also generates an N index identifier and an access-chain block identifier. However, when generating the block = header, the maintainer node of the parallel chain adds only a parallel-chain block identifier to N 25 — the block header, but adds the access-chain block identifier to a position after the block header. a In addition, for the index identifier, the maintainer node of the parallel chain adds a E corresponding index identifier to a position after the access-chain block identifier based on a N type of each block data. For example, at the position after the access-chain block identifier, the - maintainer node of the parallel chain firstly adds an index identifier of each transaction information, secondly adds an index identifier of each state information, subsequently adds an 12 index identifier of each receipt information, and finally adds an index identifier of each data information. After the index identifiers are added, the maintainer node of the parallel chain converts the block data into data conforming to the specification form of the public chain, and adds the data to the position after the index identifier, to generate the parallel-chain block. [0061] [0061] For example, as shown in FIG. 4, the to-be-synchronized blocks are a 500" block 40 and a 501" block 41 in a blockchain A of the access chain. Each to-be-synchronized block respectively includes four types of block data which respectively are: transaction information El and F2, state information F1 and F2, receipt information G1 and G2, and data information H1 and H2. The maintainer node of the parallel chain generates a 250" block 42 in a blockchain B of the parallel chain. When generating the block 42, the maintainer node of the parallel chain needs to synchronize block data in the block 40 and the block 41 into the block 42. The block 42 sequentially includes: a block header 421, access-chain block identifiers 422: "500+A-Block500-hash" and "501+A-Block501-hash", index identifiers 423: El-hash and E2-hash of the transaction information E1 and E2, index identifiers 424: F1-hash and F2-hash — of the state information F1 and F2, index identifiers 425: G1-hash and G2-hash of the receipt information G1 and G2, index identifiers 426: H1-hash and H2-hash of the data information H1 and H2, and eight pieces of block data that are converted to conform to the specification form of the public chain: transaction information el and e2, state information fl and f2, receipt information gl and g2, and data information hl and h2. The block header 421 includes a — parallel-chain block identifier "250+B-Block250-hash" corresponding to the block 42. [0062] [0062] According to the foregoing two manners, the block data in the to-be-synchronized S block may be synchronized to the parallel-chain blockchain that may be accessed by the public N chain. No matter in the first manner or in the second matter, when reading the block data, the - public chain determines a parallel-chain block where the block data is provided by using the N 25 — parallel-chain block identifier; subsequently, verifies an access-chain block in the access chain a to which the block data belongs by using the access-chain block identifier; and finally E determines and reads the block data by using the index identifier However, for the N parallel-chain block generated through the first manner, while being read, the block data is - directly copied from the access-chain block. Therefore, the public chain needs to read the block — data according to a data reading rule of the access chain. For the parallel-chain block generated 13 through the second manner, while being read, because the block data has been converted into data conforming to the specification form of the public chain, the public chain may directly read the block data. [0063] [0063] For the first manner, the maintainer node of the parallel chain may quickly generate — the parallel-chain block, having relatively high efficiency. However, the public chain reads the block data at a relatively slow speed, thus reducing efficiency of the cross-chain transaction. For the second manner, efficiency for the maintainer node of the parallel chain to generate the parallel-chain block is relatively low. However, the public chain reads the block data at a relatively fast speed. In this way, efficiency of the cross-chain transaction may be improved. [0064] [0064] It should be noted that in addition to various identifiers and the block data relevant to the to-be-synchronized block, the parallel-chain block may further include information and data relevant to the parallel chain, such as transaction information relevant to the cross-chain transaction, and a smart contract deployed on the parallel chain. [0065] [0065] In a possible implementation, the maintainer node of the parallel chain generates only — one parallel-chain block at one time. K to-be-synchronized blocks may be synchronized in one parallel-chain block, where k is a positive integer greater than or equal to 2. Therefore, whenever generating the parallel-chain block, the maintainer node of the parallel chain synchronizes at most two to-be-synchronized blocks. If a value of k is greater than 2, whenever generating the parallel-chain block, there are excessive block data to be synchronized by the maintainer node of the parallel chain. As a result, efficiency of generating the parallel-chain block is reduced. Moreover, when one parallel-chain block includes block data of excessive S access—chain blocks, when read certain block data, the public chain needs to spend too much N time on searching in the parallel-chain block, thus affecting the efficiency of the cross-chain - transaction. Specifically, the maintainer node of the parallel chain may generate a parallel-chain N 25 — block conforming to the specification form of the public chain every preset duration. The preset a duration is k times of duration reguired by the access chain to generate a block. For example, E the duration reguired by the access chain to generate a block is 10 minutes. In this case, if it is N set that the parallel-chain block includes block data of three to-be-synchronized blocks, the - maintainer node of the parallel chain generates a parallel-chain block every 30 minutes. The maintainer node of the parallel chain may control a frequency of generating the parallel-chain 14 block to control a number of blocks that are synchronized every time. [0066] [0066] Step S22: Add the parallel-chain block to a parallel-chain blockchain. [0067] [0067] After the parallel-chain block is generated, the maintainer node of the parallel chain adds the parallel-chain block to the parallel-chain blockchain, and synchronizes the same in the 3 — parallel chain, to reach a consensus of other parallel-chain nodes. [0068] [0068] When performing a cross-chain transaction, the public chain needs to obtain one or more block data of the access chain. For any block data, the public chain needs to read the block data based on a group of digest information. The group of digest information includes the parallel-chain block identifier that is configured to determine the parallel-chain block where the — block data is in, the access-chain block identifier that is configured to verify the access-chain blocks to which the block data belongs, and the index identifier of the block data. Therefore, before reading one piece of block data, the public chain first needs to obtain a group of digest information corresponding to the block data. Regarding this, because the public chain may directly access the parallel-chain blockchain, the public chain may periodically obtain digest information corresponding to each block data stored in the parallel-chain blockchain. In some other embodiments, after the maintainer node of the parallel chain generates a parallel-chain block, digest information corresponding to each data in the parallel-chain block is sent to the public chain. [0069] [0069] Further, as shown in FIG. 5, the foregoing step S20 of determining, by the maintainer node of the parallel chain, the to-be-synchronized blocks in the access-chain blockchain includes the following sub-steps. S [0070] S201: Determine that a number of current blocks in the access-chain blockchain as m. N [0071] S202: Determine that first (m-n) blocks in the access-chain blockchain as consensus = blocks. [0074] [0074] Usually, there is more than one maintainer node that has an accounting right in the blockchain network. Therefore, for generating of a block having a serial number, different maintainer nodes may generate different blocks have a same serial number. In this case, because — the blocks having the same serial number are different, different blockchains may occur in a same blockchain network. In this case, the blockchain network uses a consensus mechanism thereof to enable all nodes to reach a consensus of acknowledging only one of the foregoing different blockchains, thus ensuring uniqueness of maintained blockchain. The consensus block is a block in the access-chain blockchain on which all access-chain nodes have reached a consensus. Once a block on which all nodes reach a consensus, the block may not be rewritten or changed. [0075] [0075] The maintainer node of the parallel chain needs to make sure that the synchronized block data is correct and unchangeable. Therefore, the synchronized block data is block data in the consensus block. Because a number of blocks in the access-chain blockchain is increasing IS and it takes some time for the blockchain to reach a consensus by the nodes, it is possible that the access-chain blockchain that is obtained by the maintainer node of the parallel chain may include a block on which the nodes have not reached a consensus yet. However, the maintainer node of the parallel chain may determine the first (m-n) blocks in the access-chain blockchain as the consensus blocks, where n is a value preset according to actual experience, and is a positive integer greater than 0. For different access chains, amounts of nodes are different, duration for generating blocks are different, and consensus mechanisms are different, and therefore, n have S different specific values. For example, in a blockchain of Ethereum, a value of n is 10; and in a N blockchain of bitcoins, a value of n is 6. iq [0076] For example, the value of n is 6. If the maintainer node determines that a number of - 25 — current blocks in the access-chain blockchain is 10005, it may be determined that first 9999 , blocks in the access-chain blockchain are consensus blocks. E [0077] After the consensus blocks in the access chain are determined, the maintainer node of N the parallel chain determines, based on an access-chain block identifier included in each block - in the parallel-chain blockchain, the consensus block whose block data has not been synchronized yet. For example, first 9999 blocks in the access-chain blockchain are consensus 16 blocks, wherein the parallel chain has synchronized first 9997 access-chain blocks, and then the access-chain block identifiers indicating the first 9997 access-chain blocks is included in the parallel-chain blocks. The maintainer node of the parallel chain may determine that there is not the respective access-chain block identifiers corresponding to a 9998™ access-chain block and a 9999 access-chain block, and then the maintainer node of the parallel chain determines the two blocks as to-be-synchronized blocks. [0078] [0078] In the present application, the maintainer node of the parallel chain generates the parallel-chain block conforming to the specification form of the public chain, and enables the block data in the to-be-synchronized block in the access-chain blockchain to be included in the — parallel-chain block. Because a parallel-chain node per se is a public-chain node, the parallel chain is a subchain of the public chain. As a part of the public chain, the subchain is consistent with the public chain in terms of nodes and a network system. Therefore, a blockchain of the subchain may be directly accessed by the public chain. Therefore, when performing a cross-chain transaction relevant to the access chain, the public chain may read the block data of IS — the access chain from the parallel-chain block in a manner of reading block data of the subchain, to implement the cross-chain transaction. [0079] [0079] The present application further provides a blockchain parallel chain, wherein the parallel chain is composed of common nodes of a public chain and an access chain, and includes maintainer nodes of the parallel chain that are periodically selected from nodes in the — parallel chain. The parallel chain may be configured to implement the foregoing method examples. S [0080] The maintainer node of the parallel chain is configured to: determine N to-be-synchronized blocks in a access-chain blockchain; generate a parallel-chain block = conforming to a specification form of the public chain, where the parallel-chain block includes N 25 — block data in the to-be-synchronized block; and add the parallel-chain block to a parallel-chain a blockchain, so that the public chain may reads the block data in the to-be-synchronized block E from the parallel-chain blockchain. ä [0081] In a possible implementation, the maintainer node of the parallel chain is specifically configured to: [0082] [0082] generate an index identifier for indicating the block data in the to-be-synchronized 17 block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; generate a block header conforming to the specification form of the public chain, where the block header includes the index identifier, the access-chain block identifier, and a parallel-chain block identifier for indicating the parallel-chain block in the — parallel-chain blockchain; and copy the block data in the to-be-synchronized block to a position after the block header, to generate the parallel-chain block. [0083] [0083] In another possible implementation, the maintainer node of the parallel chain is specifically configured to: generate an index identifier for indicating the block data in the to-be-synchronized block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; generate a block header conforming to the specification form of the public chain, where the block header includes a parallel-chain block identifier for indicating the parallel-chain block in the parallel-chain blockchain; add the access-chain block identifier to a position after the block header; add the index identifier to a position after the access-chain block identifier according to a type of the block data, where the — type of the block data includes transaction information, state information, receipt information, and data information; and convert the block data into data conforming to the specification form of the public chain, and add the data to a position after the index identifier, to generate the parallel-chain block. [0084] [0084] In the blockchain parallel chain provided in the present application, the maintainer node of the parallel chain generates the parallel-chain block conforming to the specification form of the public chain, and enable the block data in the to-be-synchronized block in the S access-chain blockchain to be included in the parallel-chain block. Because a parallel-chain N node per se is a public-chain node, the parallel chain is a subchain of the public chain. As a part iq of the public chain, the subchain is consistent with the public chain in terms of nodes and a - 25 — network system. Therefore, a blockchain of the subchain may be directly accessed by the public a chain. Therefore, when performing a cross-chain transaction relevant to the access chain, the E public chain may read the block data of the access chain from the parallel-chain block in a N manner of reading block data of the subchain, to implement the cross-chain transaction. - [0085] A person skilled in the art can clearly learn that the technology in the embodiments of the present application may be implemented through software in combination with a necessary 18 general hardware platform. On the basis of such understanding, the technical solutions in the embodiments of the present application essentially or parts of the technical solutions in the embodiments of the present application that attribute to the prior art may be represented in software products. A computer software product may be stored in the storage medium, such as the ROM/RAM, a magnetic disk, or a compact disc, and includes a plurality of instructions to enable a computer device (which may be a personal computer, a server, a network device, or the like) to implement the method in all embodiments or in some embodiments of the present application. [0086] [0086] A person skilled in the art would easily conceive of other implementation solutions of — this disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variation, use, or adaptive change of this disclosure. These variations, uses, or adaptive changes follow the general principle of this disclosure and include the common general knowledge or common technical means in this technical filed that is not disclosed in this disclosure. The specification and the embodiments are — merely considered as exemplary, and the actual scope and spirit of the present application are indicated in the claims. [0087] [0087] It should be understood that the present application is not limited to the content that is described above and is shown in the figures, and various modifications and changes can be made thereto, without departing from the scope thereof. The scope of the present application is — merely limited by the appended claims. [0088] [0088] In addition, in the description of the present application, unless otherwise stated, "a S plurality of" means two or more than two. In addition, for ease of clearly describing the N technical solutions in the embodiments of the present application, in the embodiments of the iq present application, words such as "first" and "second" are used to distinguish same or similar - 25 items with basically the same functions. A person skilled in the art may understand that the a words such as "first" and "second" do not limit a number and an execution order, and the words E such as "first" and "second" do not necessarily mean that the items are different.S N 19
权利要求:
Claims (10) [1] 1. A method for maintaining a blockchain parallel chain comprising: determining a to-be-synchronized block in an access-chain blockchain; generating a parallel-chain block conforming to a specification form of a public chain, wherein the parallel-chain block comprises block data in the to-be-synchronized block; and adding the parallel-chain block to a parallel-chain blockchain, so as to read the block data in the to-be-synchronized block from the parallel-chain blockchain by the public chain. [2] 2. The method according to claim 1, wherein the generating a parallel-chain block conforming to a specification form of a public chain comprises: generating an index identifier for indicating the block data in the to-be-synchronized block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; generating a block header conforming to the specification form of the public chain, wherein the block header comprises the index identifier, the access-chain block identifier, and a parallel-chain block identifier for indicating the parallel-chain block in the parallel-chain blockchain; and copying the block data in the to-be-synchronized block to a position after the block header, to generate the parallel-chain block. O N O N N [3] 3. The method according to claim 1, wherein the generating a parallel-chain block N conforming to a specification form of a public chain comprises: I & generating an index identifier for indicating the block data in the to-be-synchronized block O and an access-chain block identifier for indicating the to-be-synchronized block in the © S access-chain blockchain; N generating a block header conforming to the specification form of the public chain, wherein the block header comprises a parallel-chain block identifier for indicating the parallel-chain 1/4 block in the parallel-chain blockchain; adding the access-chain block identifier to a position after the block header; adding the index identifier to a position after the access-chain block identifier according to a type of the block data, wherein the type of the block data comprises transaction information, state information, receipt information, and data information; and converting the block data into data conforming to the specification form of the public chain, and adding the data to a position after the index identifier, to generate the parallel-chain block. [4] 4. The method according to claim 2 or 3, wherein the method further comprises: after the generating a parallel-chain block conforming to a specification form of a public chain, sending digest information corresponding to the block data to the public chain, so as to read the block data in the to-be-synchronized block from the parallel-chain blockchain by the public chain based on the digest information, wherein the digest information comprises the access-chain block identifier, the parallel-chain block identifier, and the index identifier, which correspond to the block data. [5] 5. The method according to claim 2 or 3, wherein the determining to-be-synchronized blocks in an access-chain blockchain comprises: determining a number of current blocks in the access-chain blockchain as m; O O determining first (m-n) blocks in the access-chain blockchain as consensus blocks, wherein N n is a preset value, the consensus blocks are blocks in the access-chain blockchain on which N access-chain nodes have reached a consensus, and n is a positive integer greater than 0; and I i determining, based on the access-chain block identifier in the parallel-chain blockchain, a 2 block in the consensus blocks whose block data is not synchronized, as the to-be-synchronized © S block. O N [6] 6. The method according to claim 1, wherein a number of the to-be-synchronized blocks is 2/4 k, which is a positive integer greater than or equal to 2; and the generating a parallel-chain block conforming to a specification form of a public chain comprises: generating one parallel-chain block conforming to the specification form of the public chain every preset duration, wherein the preset duration is k times greater than a duration required by the access chain to generate a block. [7] 7. The method according to any one of claims 1 to 3, wherein the method further comprises: periodically selecting a maintainer node of the parallel chain from nodes in the parallel chain, wherein the parallel-chain block is generated by the maintainer node of the parallel chain. [8] 8. A blockchain parallel chain, wherein the parallel chain consists of nodes shared by a public chain and an access chain, and comprises a maintainer node of the parallel chain, which is periodically selected from the nodes in the parallel chain; and the maintainer node of the parallel chain is configured to: determine a to-be-synchronized block in an access-chain blockchain; generate a parallel-chain block conforming to a specification form of the public chain, wherein the parallel-chain block comprises block data in the to-be-synchronized block; and add the parallel-chain block to a parallel-chain blockchain, so as to read the block data in the to-be-synchronized block from the parallel-chain blockchain by oO the public chain. N O N N N [9] 9. The blockchain parallel chain according to claim 8, wherein the maintainer node of the E parallel chain is further configured to: generate an index identifier for indicating the block data in the to-be-synchronized block © and an access-chain block identifier for indicating the to-be-synchronized block in the O N access-chain blockchain; generate a block header conforming to the specification form of the public chain, wherein 3/4 the block header comprises the index identifier, the access-chain block identifier, and a parallel-chain block identifier for indicating the parallel-chain block in the parallel-chain blockchain; and copy the block data in the to-be-synchronized block to a position after the block header, to generate the parallel-chain block. [10] 10. The blockchain parallel chain according to claim 8, wherein the maintainer node of the parallel chain is further configured to: generate an index identifier for indicating the block data in the to-be-synchronized block and an access-chain block identifier for indicating the to-be-synchronized block in the access-chain blockchain; generate a block header conforming to the specification form of the public chain, wherein the block header comprises a parallel-chain block identifier for indicating the parallel-chain block in the parallel-chain blockchain; add the access-chain block identifier to a position after the block header; add the index identifier to a position after the access-chain block identifier according to a type of the block data, wherein the type of the block data comprises transaction information, state information, receipt information, and data information; and convert the block data into data conforming to the specification form of the public chain and o add the data to a position after the index identifier, to generate the parallel-chain block. & N N N I a a © LO ™ © O N O N 4/4
类似技术:
公开号 | 公开日 | 专利标题 FI20206356A1|2020-12-22|Method for maintaining blockchain parallel chain and blockchain parallel chain CN110602148B|2021-07-06|Method and device for generating state tree of block and verifying data on chain WO2019101229A2|2019-05-31|Updating blockchain world state merkle patricia trie subtree CN110958117A|2020-04-03|Block chain interoperability with support for zero knowledge proof US10572352B2|2020-02-25|Byzantine fault tolerance with verifiable secret sharing at constant overhead EP3812992A1|2021-04-28|Block chain transaction method and apparatus CN111448781A|2020-07-24|Shared blockchain data storage US20210150517A1|2021-05-20|Invoice invalidation method and apparatus based on blockchain, and electronic device US11263623B1|2022-03-01|Method and apparatus for grouping transactions in blockchain CN109194646B|2021-05-25|Safety authentication data access method based on block chain CN111095210A|2020-05-01|Storing shared blockchain data based on error correction coding KR20210045353A|2021-04-26|Indexing and recovery of encoded blockchain data WO2019072298A2|2019-04-18|Shared secret-based blockchain storage CN111935000B|2021-01-08|Message transmission method and device CN113079079A|2021-07-06|Message transmission method and device CN111226209A|2020-06-02|Performing mapping iterations in a blockchain based system US20210064585A1|2021-03-04|Methods and devices for providing traversable key-value data storage on blockchain Alturki et al.2019|Towards a verified model of the algorand consensus protocol in coq US20190278765A1|2019-09-12|Shared secret-based blockchain storage WO2020042937A1|2020-03-05|Maintenance method for blockchain parachain, and blockchain parachain Ali et al.2017|Blockstack Technical Whitepaper CN112953821B|2022-02-25|Message transmission method and device US10963854B2|2021-03-30|Blockchain-based electronic bill reimbursement method, apparatus, and electronic device WO2020220251A1|2020-11-05|Data processing method for blockchain system and block generating method CN111640018A|2020-09-08|Block chain transaction existence verification method and device
同族专利:
公开号 | 公开日 CN110868438A|2020-03-06| CN110868439A|2020-03-06| CN110866751A|2020-03-06| CN110866826A|2020-03-06| JP2021527373A|2021-10-11| CN110866823A|2020-03-06| CN110868441B|2021-03-16| CN110866825A|2020-03-06| CN110866750A|2020-03-06| CN110868438B|2022-01-07| CN110868440B|2021-03-16| CN110866824A|2020-03-06| CN110868440A|2020-03-06| FI129087B|2021-06-30| FI20206009A1|2020-10-14| CN110868308A|2020-03-06| CN110868439B|2021-05-28| CN110868441A|2020-03-06|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题 CN105404701B|2015-12-31|2018-11-13|浙江图讯科技股份有限公司|A kind of heterogeneous database synchronization method based on peer-to-peer network| US20170236123A1|2016-02-16|2017-08-17|Blockstack Inc.|Decentralized processing of global naming systems| JP6628188B2|2016-05-10|2020-01-08|日本電信電話株式会社|Payment system, payment method, transaction generation device, and transaction generation program| KR101780636B1|2016-05-16|2017-09-21|주식회사 코인플러그|Method for issuing certificate information and blockchain-based server using the same| US9635000B1|2016-05-25|2017-04-25|Sead Muftic|Blockchain identity management system based on public identities ledger| CN106204287A|2016-07-18|2016-12-07|上海仲托网络科技有限公司|Mutual insurance based on block chain and help each other guarantee operation method and system| CN106357405A|2016-09-19|2017-01-25|弗洛格(武汉)信息科技有限公司|Method and system for managing data on basis of block chain technology consistency algorithms| CN106503098B|2016-10-14|2021-11-12|中金云金融(北京)大数据科技股份有限公司|Block chain cloud service framework system built in Paas service layer| CN106559211B|2016-11-22|2019-12-13|中国电子科技集团公司第三十研究所|Privacy protection intelligent contract method in block chain| CN106779805A|2016-11-24|2017-05-31|中国银行股份有限公司|Integration circulation method and device between a kind of different businessmans based on block chain| CN106790513A|2016-12-19|2017-05-31|杜伯仁|The method that network share service is realized based on block chain| US10484346B2|2017-02-07|2019-11-19|Microsoft Technology Licensing, Llc|Establishment of consortium blockchain network| CN107103054B|2017-04-12|2019-03-26|北京航空航天大学|A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain| CN107147704B|2017-04-21|2019-12-13|杭州趣链科技有限公司|block chain-oriented universal service middleware system| CN107294727B|2017-05-22|2020-06-19|联动优势科技有限公司|Electronic voting method, terminal equipment and block chain network| CN107341660B|2017-05-27|2021-06-29|唐盛(北京)物联技术有限公司|Block chain bottom layer consensus mechanism and block chain system based on same| CN107231299A|2017-06-07|2017-10-03|众安信息技术服务有限公司|A kind of chain route and realized the system that block chain communicates across chain| CN107301600B|2017-06-23|2021-07-20|北京天德科技有限公司|Core construction method of block chain Internet model for cross-chain transaction| CN107248076A|2017-06-24|2017-10-13|北京天德科技有限公司|A kind of core algorithm of the double-chain block chain the Internet model merchandised across chain| CN107888562B|2017-10-13|2019-12-27|布比(北京)网络技术有限公司|Data verification and transceiving method, node and system for parallel link access to interconnection chain| CN107909369A|2017-10-13|2018-04-13|布比(北京)网络技术有限公司|Based on the common recognition method, apparatus merchandised across chain and storage medium| CN108280646A|2018-01-19|2018-07-13|中国科学院软件研究所|Block chain group chain method based on alliance's chain and block catenary system| CN108055138B|2018-02-01|2020-03-17|国家计算机网络与信息安全管理中心|Block chain-based application distribution recording method and system| CN108347486A|2018-02-12|2018-07-31|众安信息技术服务有限公司|Across chain communication means, device and system based on block chain| CN108389047B|2018-02-12|2021-07-09|南京思利华信息科技有限公司|Method for trading between parent chain and child chain in block chain and block chain network| CN108415784B|2018-02-27|2020-04-24|阿里巴巴集团控股有限公司|Cross-block-chain interaction method, device, system and electronic equipment| CN108416589A|2018-03-08|2018-08-17|深圳前海微众银行股份有限公司|Connection method, system and the computer readable storage medium of block chain node| CN108416578A|2018-03-14|2018-08-17|郑杰骞|A kind of block catenary system and data processing method|CN111612614A|2019-02-26|2020-09-01|傲为信息技术有限公司|Public link-based sub-chain service system| CN111404962A|2020-03-26|2020-07-10|杭州复杂美科技有限公司|Federation link point data transmission method, equipment and storage medium| CN111245966B|2020-04-29|2020-07-28|之江实验室|Vehicle networking information sharing method based on block chain architecture| CN113067901B|2021-06-02|2021-09-24|支付宝信息技术有限公司|Method for creating block chain subnet| CN113726913A|2021-11-04|2021-11-30|中国信息通信研究院|Backbone node access method and block chain system| CN113822656B|2021-11-23|2022-02-11|江苏荣泽信息科技股份有限公司|Cross-chain cooperation method based on block chain technology|
法律状态:
优先权:
[返回顶部]
申请号 | 申请日 | 专利标题 CN201810986825|2018-08-28| CN201910145999.1A|CN110866751A|2018-08-28|2019-02-27|Block chain parallel chain maintenance method and block chain parallel chain| PCT/CN2019/101059|WO2020042937A1|2018-08-28|2019-08-16|Maintenance method for blockchain parachain, and blockchain parachain| 相关专利
Sulfonates, polymers, resist compositions and patterning process
Washing machine
Washing machine
Device for fixture finishing and tension adjusting of membrane
Structure for Equipping Band in a Plane Cathode Ray Tube
Process for preparation of 7 alpha-carboxyl 9, 11-epoxy steroids and intermediates useful therein an
国家/地区
|